import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: 'row_id',
    align:"center",
    dataIndex: 'rowId'
   },
   {
    title: 'teamId',
    align:"center",
    dataIndex: 'teamId'
   },
   {
    title: '图片地址',
    align:"center",
    dataIndex: 'imageurl'
   },
   {
    title: '团队人员名称',
    align:"center",
    dataIndex: 'teammxname'
   },
   {
    title: '地区顾问',
    align:"center",
    dataIndex: 'areaadviser'
   },
   {
    title: '负责地区',
    align:"center",
    dataIndex: 'importarea'
   },
   {
    title: '咨询信息',
    align:"center",
    dataIndex: 'serviceinfo'
   },
   {
    title: '排序名称',
    align:"center",
    dataIndex: 'seqId'
   },
   {
    title: '案例总数',
    align:"center",
    dataIndex: 'casenumber'
   },
   {
    title: '咨询认识',
    align:"center",
    dataIndex: 'personnumber'
   },
   {
    title: '工作年限',
    align:"center",
    dataIndex: 'worktime'
   },
   {
    title: '个人简介',
    align:"center",
    dataIndex: 'jiangjie'
   },
   {
    title: '教育背景',
    align:"center",
    dataIndex: 'jaoyubeij'
   },
   {
    title: '顾问级别',
    align:"center",
    dataIndex: 'dictionariesId'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'row_id',
    field: 'rowId',
    component: 'Input',
  },
  {
    label: 'teamId',
    field: 'teamId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入teamId!'},
          ];
     },
  },
  {
    label: '图片地址',
    field: 'imageurl',
    component: 'InputTextArea',
  },
  {
    label: '团队人员名称',
    field: 'teammxname',
    component: 'Input',
  },
  {
    label: '地区顾问',
    field: 'areaadviser',
    component: 'Input',
  },
  {
    label: '负责地区',
    field: 'importarea',
    component: 'Input',
  },
  {
    label: '咨询信息',
    field: 'serviceinfo',
    component: 'Input',
  },
  {
    label: '排序名称',
    field: 'seqId',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入排序名称!'},
          ];
     },
  },
  {
    label: '案例总数',
    field: 'casenumber',
    component: 'InputNumber',
  },
  {
    label: '咨询认识',
    field: 'personnumber',
    component: 'InputNumber',
  },
  {
    label: '工作年限',
    field: 'worktime',
    component: 'InputNumber',
  },
  {
    label: '个人简介',
    field: 'jiangjie',
    component: 'InputTextArea',
  },
  {
    label: '教育背景',
    field: 'jaoyubeij',
    component: 'Input',
  },
  {
    label: '顾问级别',
    field: 'dictionariesId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  rowId: {title: 'row_id',order: 0,view: 'text', type: 'string',},
  teamId: {title: 'teamId',order: 1,view: 'text', type: 'string',},
  imageurl: {title: '图片地址',order: 2,view: 'textarea', type: 'string',},
  teammxname: {title: '团队人员名称',order: 3,view: 'text', type: 'string',},
  areaadviser: {title: '地区顾问',order: 4,view: 'text', type: 'string',},
  importarea: {title: '负责地区',order: 5,view: 'text', type: 'string',},
  serviceinfo: {title: '咨询信息',order: 6,view: 'text', type: 'string',},
  seqId: {title: '排序名称',order: 7,view: 'number', type: 'number',},
  casenumber: {title: '案例总数',order: 8,view: 'number', type: 'number',},
  personnumber: {title: '咨询认识',order: 9,view: 'number', type: 'number',},
  worktime: {title: '工作年限',order: 10,view: 'number', type: 'number',},
  jiangjie: {title: '个人简介',order: 11,view: 'textarea', type: 'string',},
  jaoyubeij: {title: '教育背景',order: 12,view: 'text', type: 'string',},
  dictionariesId: {title: '顾问级别',order: 13,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}